home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Leonardo the Inventor
/
Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso
/
LEOWINMV
/
DATABASE.DIR
/
00095_Script_PRINT PICTURES
< prev
next >
Wrap
Text File
|
1996-03-28
|
5KB
|
161 lines
-----------------------------------------------------------------------
-- handler printItem determines if the item to be printed is text, a
-- map or a picture and calls the appropriate print handler to print
-- the item.
on printItem
global printButton
global clickedTopic
activateButtonKeepActivated(the clickOn)
-- switch off puppets so they don't print
-- set puppetList = []
-- set puppetList = getPuppetList()
-- setPuppets puppetList,0
-- first get the framelabel for this topic
-- set topicFrameLabel = getMarkerForTopic(clickedTopic)
-- then determine if a portrait, a map or text is shown by determining
-- if the corresponding button is active
-- if the name of cast (the castNum of sprite pictureButton) = "Picture ACTIVATED" then
-- printPicture(topicFrameLabel)
-- end if
-- if the name of cast (the castNum of sprite textButton) = "Text ACTIVATED" then
printTopicText
-- end if
-- if the name of cast (the castNum of sprite mapButton) = "Map ACTIVATED" then
-- setTextField clickedTopic
-- set topicPrintFrame = topicFrameLabel && "PRT"
-- printFrame label(topicPrintFrame) + 1
-- setButtonState(textState,textButton)
-- end if
-- switch puppets back on
-- setPuppets puppetList,1
end
-- ---------------------------------------------------------------
-- Handler getMarkerForTopic
on getMarkerForTopic whichTopic
global topicMarkers
set topicLine = 1
set the itemDelimiter = ":"
repeat with i = 1 to the number of lines in topicMarkers
if (item 1 of line i of topicMarkers = whichTopic) then
set marker = item 2 of line i of topicMarkers
set the itemDelimiter = ","
exit repeat
end if
end repeat
return marker
end
-----------------------------------------------------------------------
-- Handler printFrame does the actual printing of non-text items.
on printFrame aPrintFrame
global hilitTopic
-- convert aPrintFrame to a number when printing a map
if stringP(aPrintFrame) then
set aPrintFrame = label(aPrintFrame)
end if
set oldStageColor = the stagecolor
set the stageColor = 0
set saveHilitTopicPos = the locH of sprite hilitTopic
set the locH of sprite hilitTopic = 3000
printFrom aPrintFrame,aPrintFrame
set the locH of sprite hilitTopic = saveHilitTopicPos
set the stageColor = oldStageColor
end
-----------------------------------------------------------------------
-- handler setTextField sets up properties of the textfield containing
-- the topic in the print frame.
on setTextField aTopic
put " " into field "topicName"
set the textFont of field "topicName" = "Palatino"
set the textSize of field "topicName" = 18
set the textAlign of field "topicName" = "left"
put aTopic into field "topicName"
end
-----------------------------------------------------------------------
-- handler setPuppets sets the puppets in list aList to state state
on setPuppets aList,state
repeat with i = 1 to count(aList)
puppetsprite getAt(aList,i),state
end repeat
end
-----------------------------------------------------------------------
-- handler getPuppetList returns a list of all the puppetsprites in the
-- current frame
on getPuppetList
set puppetList = []
repeat with i = 1 to 48
if the puppet of sprite i then append(puppetList,i)
end repeat
return puppetList
end
-----------------------------------------------------------------------
-- handler printLandscape prints a screenShot of the current 13" screen
-- (640 wide by 480 tall), scaled up to fit an 11 x 8.5 inch page...
-- (not recommended for monitors/windows smaller than 640 x 480 at this time):
on printLandscape
global utilObj
openXObjHandler("MovieUtilities.XObj")
set utilObj = MovieUtilities( mNew )
if objectP( utilObj ) then
put utilObj( mPrintLandscape ) into result
if result < 0 then
alert "Sorry...Error" && result && "prevented printing from occurring."
exit
end if
else
alert "Sorry...no object has been created"
end if
utilObj(mdispose)
closeXObjHandler("MovieUtilities.XObj")
end
-----------------------------------------------------------------------
-- handler printPicture prints a picture in landscape form. The picture
-- must be stored in a frame of the form <topicFrameLabel> && PRT. The
-- handler has to go to the frame to print in landscape form. It then
-- returns to the source frame and returns the buttonstates of the
-- database.
on printPicture topicFrameLabel
global clickedTopic
setTextField(clickedTopic)
set topicPrintFrame = topicFrameLabel && "PRT"
printFrame topicPrintFrame
showPicture
end